package Thread;

public class ThreadDemo05 {
    public static void main(String[] args) {
        // lambda 表达式
        Thread t = new Thread(()->{
            while(true){
                System.out.println("hello thread05!");
                try {
                    Thread.sleep(300);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        });

        t.start();

        while(true){
            System.out.println("hello main thread!");
            try {
                Thread.sleep(300);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
